home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_03
/
1003032b
< prev
next >
Wrap
Text File
|
1992-01-11
|
2KB
|
57 lines
EXAMPLE 2 :
/****************************************************
* This code declares tests objects, test_a, test_b
* and test_c. These objects attach their own
* initialization, processing and display routines
* to the pointers provided.
* Each test has its own name and initialization methods,
* but inherits its store and display methods from it's
* respective class, ie. test_b from class_1, test_c from
* class_2.
*
* Construct Name Location
*
* CLASS TEST_CLASS class header file ROM
* SUBCLASS class_1, class_2 class specific files ROM
* OBJECTS test_a, test_b object specific files ROM
*
* The "const" directive tells the compiler to place
* the test objects in ROM.
****************************************************/
file test_a.c
/***** Definition of Object "A" *******/
const TEST_CLASS test_a = { "TEST A",
object_a_init,
class_1_process_data,
class_1_display
};
file test_b.c
/***** Definition of Object "B" ********/
const TEST_CLASS test_b = { "TEST B",
object_b_init,
class_1_process_data,
class_1_display
};
file test_c.c
/***** Definition of Object "C" ********/
const TEST_CLASS test_c = { "TEST C",
object_c_init,
class_2_process_data,
class_2_display
};